<?php

class Kzend_Auth_Adapter_Simple implements Zend_Auth_Adapter_Interface
{
    const FAILURE = Zend_Auth_Result::FAILURE;
    const SUCCESS = Zend_Auth_Result::SUCCESS;

    private $_authFlag;
    private $_identity;
    private $_messages;

    public function __construct($authFlag, $identity, $messages = array())
    {
        $this->_authFlag = $authFlag;
        $this->_identity = $identity;
        $this->_messages = $messages;
    }

    public function authenticate()
    {
        if ($this->_authFlag == Zend_Auth_Result::SUCCESS) {
            Zend_Session::regenerateId();
        }

        return new Zend_Auth_Result($this->_authFlag, $this->_identity, $this->_messages);
    }
}

